Chris Pollett > Old Classes >
CS152

( Print View )

Student Corner:
  [Grades Sec1]

  [Submit Sec1]

  [Class Sign Up Sec1]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]  [Hw6]

Practice Exams:
  [Mid]  [Final]

                           












HW#4 --- last modified February 28 2019 22:31:58..

Solution set.

Due date: Nov 10

Files to be submitted:
  Hw4.zip

Purpose: To become familiar with the Scheme Programming language. To use message passing as a method of designing object-oriented programs.

Related Course Outcomes:

The main course outcomes covered by this assignment are:

(2) [Have a basic knowledge of the procedural, object-oriented, functional, and logic programming paradigms.]

(11)[Produce programs in a functional programming language in excess of 200 lines of code.]

Specification:

Zork is a highly influential computer game that was originally written in a Lisp variant. You can still play it online. You might want to check out other famous games that were coded using Lisp-like languages such as Nethack. For this homework you are to write you're own Adventure/Zork-style game using Scheme. On the day the Homework is due you should bring a laptop with your running programming so everyone can see it. i.e., we'll demo our games to each other in class.

Although your peers will judge your program based on how cool it is, the grader needs to have something more concrete to grade on. First, the grader will check if you are following: The Scheme Coding Guidelines. Your program will be run within Dr. Scheme using the R5RS language. The grader will unzip the file Hw4.zip, and open the file game.scm from the resulting folder in Dr. Scheme. The grader will then type:

(start-game)

to begin playing the game. Your game should support the actions N, S, E, W (North, South, East, West) at least to move around the game space. The code of the game should be built out of objects which can be sent messages. For instance, you might have a game-board object, when the user type N and enter, it corresponds to sending the game-board object the message 'north . i.e., (game-board 'north). The game board object preserves in its internal state where you are in the game world. The game-board object might have a list of sub-objects on it. You might have room objects which might be what the player lives in at any given time. Each room object might further have other objects in it. For instance, you might have a candlestick object. This object might in turn have a state such as lit or unlit. Your game should have a goal. i.e., Find the Amulet of Yendor or something. You should have a cheat.txt file in the Hw4.zip explaining to the grader some trick to make the game trivial to win, so that the grader can check this. You should also have a parsing object that handles the user input parsing. Your program must be greater than 200 lines of Scheme code. Not counting comments or trivial lines. Other than these constraints, be creative, and make as cool a game as possible!

Point Breakdown

Scheme Coding Guidelines Followed 1pt
Game can be run as described 1pt
There is a game-board object which operates as described 1pt
game-board has sub-objects list 1pt
Sub-objects have mechanism for preserving internal state 1pt
Have a parsing object. 1pt
Game has a goal. 1pt
cheat.txt is as described and instructions work. 1pt
Program is at least 200 non-trivial/non-comment lines of code. 1pt
Demo'd game on demo day. 1pt
Total10pts